package cc.lj.internal.coupons.domain.ticket.service.impl;

import cc.lj.internal.coupons.domain.ticket.model.vo.TicketBatchLifecycleContinueDO;
import cc.lj.internal.coupons.domain.ticket.model.vo.convert.TicketBatchLifecycleContinuePOConvertDO;
import cc.lj.internal.coupons.domain.ticket.service.ITicketBatchLifecycleContinueDomainService;
import cc.lj.internal.coupons.infrastructure.po.TicketBatchLifecycleContinuePO;
import cc.lj.internal.coupons.infrastructure.repository.TicketBatchLifecycleContinueRespository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * 电子券批次连续有效期领域服务service实现类
 * @author liangxifeng
 * @date 2021-12-20
 */
@Service("ticketBatchLifecycleContinueDomainServiceImpl")
@Slf4j
public class TicketBatchLifecycleContinueDomainServiceImpl implements ITicketBatchLifecycleContinueDomainService {
    @Resource(name = "ticketBatchLifecycleContinueRespository")
    private TicketBatchLifecycleContinueRespository continueRespository;

    @Override
    public List<TicketBatchLifecycleContinueDO> getNoStartList() {
        List<TicketBatchLifecycleContinuePO> listPO = continueRespository.getNoStartList();
        List<TicketBatchLifecycleContinueDO> listDO = new ArrayList<>();
        for (TicketBatchLifecycleContinuePO ticketBatchLifecycleContinuePO : listPO) {
            listDO.add(TicketBatchLifecycleContinuePOConvertDO.INSTANCE.convert(ticketBatchLifecycleContinuePO));
        }
        return listDO;
    }
}
